1. 模拟键盘输入
adb shell input keyboard text "abc"
2. 模拟点击屏幕指定位置
adb shell input tap 500 500
3. 模拟滑动
从(500,800)滑动到(500,300)
adb shell input swipe 500 800 500 300
4. 模拟Home按键
adb shell input keyevent 3
附录
安卓按键code值
KEYCODE_UNKNOWN=0;
KEYCODE_SOFT_LEFT=1;
KEYCODE_SOFT_RIGHT=2;
KEYCODE_HOME=3; //home键
KEYCODE_BACK=4; //back键
KEYCODE_CALL=5;
KEYCODE_ENDCALL=6;
KEYCODE_0=7;
KEYCODE_1=8;
KEYCODE_2=9;
KEYCODE_3=10;
KEYCODE_4=11;
KEYCODE_5=12;
KEYCODE_6=13;
KEYCODE_7=14;
KEYCODE_8=15;
KEYCODE_9=16;
KEYCODE_STAR=17;
KEYCODE_POUND=18;
KEYCODE_DPAD_UP=19;
KEYCODE_DPAD_DOWN=20;
KEYCODE_DPAD_LEFT